// 服务器全部接口相同返回的数据类型
export interface ResponseData {
    code: number,
    message: string,
    ok: boolean
}


export interface Attr {
    attrId: string | number,
    valueId: string | number,
    id: number,
    valueName: string
}

export interface saleAttr {
    saleAttrId: string | number,
    saleAttrValueId: string | number,
    id: number,
    saleAttrValueName: string
}

// 定义详情图片对象ts类型
export interface skuImageData {
    id: number,
    imgUrl: string
}

// 添加sku参数data类型
export interface SkuData {
    category3Id: string | number,
    spuId: string | number,
    tmId: string | number, // 品牌id
    skuName: string,
    price: string | number,
    weight: string | number,
    skuDesc: string,
    skuAttrValueList: Attr[],
    skuSaleAttrValueList: saleAttr[], // 销售属性
    skuDefaultImg: string,
    isSale: number, // 控制商品上架与下架
    id: number, // 商品id
    skuImageList: skuImageData[]
}

// sku接口返回数据类型
export interface SkuResponseData extends ResponseData {
    data: {
        records: SkuData[],
        total: number
        size: number
        current: number
        orders: []
        optimizeCountSql: boolean
        hitCount: boolean
        countId: null
        maxLimit: null
        searchCount: boolean
        pages: number
    }
}

// 获取商品详情的接口的ts类型
export interface SkuInfoData extends ResponseData {
    data: SkuData
}
